import type { Building } from "@/types/building"
import type { Enterprise } from "@/types/enterprise"
import type { PropertyListData, PropertyListParams, PropertyParams } from "@/types/property"
import { request } from "@/utils/reuqest"


// 获取物业费列表
export const getPropertyListAPI = (params: PropertyListParams) => {
  return request<PropertyListData>('/park/propertyfee' ,'GET', params)
}

// 查询所有企业
export const getAllEnterpriseListAPI = () => {
  return request<Enterprise[]>('/park/all/enterprise','GET')
}
// 查询所有楼宇
export const getAllBuildingListAPI = () => {
  return request<Building[]>('/park/all/building','GET')
}
// 请求计算预算金额
export const getPropertyBudgetAPI = (params: PropertyParams) => {
  return request<number>('/park/propertyfee/pre/payment','POST', params)
}

// 新增账单
export const createPropertyAPI = (data: PropertyParams) => {
  return request('/park/propertyfee','POST', data)
}
// 删除账单
export const delPropertyAPI = (id: number) => {
  return request(`/park/propertyfee/${id}`,'DELETE', {id})
}
